﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using core;

namespace comix
{
    public class Publisher:SiteItemSingle,ISiteItemMember
    {
        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public Publisher()
        {
            this.Command.CommandText = "SELECT pub_id, pub_name FROM Publishers WHERE pub_id  = @pub_id";
        }

        public override void DoFill(System.Data.SqlClient.SqlDataReader rdr)
        {
            Id = (int)rdr["pub_id"];
            name = (string)rdr["pub_name"];
        }

        public override void SetSelectParameters()
        {
            m_com.Parameters.Clear();
            m_com.Parameters.Add(new System.Data.SqlClient.SqlParameter("@pub_id", Id));
        }

        #region ISiteItemMember Members

        public void FillMember(System.Data.SqlClient.SqlDataReader rdr)
        {
            Id = (int)rdr["pub_id"];
            name = (string)rdr["pub_name"];
        }

        #endregion
    }
}
